<template>
	<view class="flex-row text-item">
		<view class="flex-row" style="width: 60%;">
			<image :src="iconSrc" style="margin-left: 8%;"></image>
			<view class="text-item-text">{{itemText}}</view>
		</view>
		<text v-show="infoText" @click="callPhone">{{infoText}}</text>
		<image v-show="infoText == null" src="../../static/goto.png" class="goto-img" @tap="goto"></image>
	</view>
</template>

<script>
	export default {
		props: {
			infoText: '',
			iconSrc: '',
			itemText: '',
			callPhoneNumber: false,
			calculator: false,
			guide: false
		},
		methods: {
			callPhone() {
				if(this.callPhoneNumber) {
					uni.makePhoneCall({
					    phoneNumber: '13286986352'
					});
				}	
			},
			goto() {
				if(this.calculator) {
					uni.navigateTo({
						url: '../../../pages/publicCalculator/publicCalculator'
					})
				}
				if(this.guide) {
					uni.navigateTo({
						url: '../../../pages/guide/guide'
					})
				}
			}
		}
	}
</script>

<style>
</style>
